package com.timber.util;

import java.util.*;
import java.text.*;
import java.sql.*;

/*
 * Title:        SLContractCore <p>
 * Description:  <p>
 * redesign of database connections management
 *
 */

/**
 *	Class holding database server properties
 */
public class SLDatabaseProperties
{

  public static String URL = "url";
  public static String PASSWORD = "password";
  public static String USER = "user";
  public static String PLAINTEXTPASSWORD = "plainTextPassword";
  public static String PASSWORDENCRYPTED = "PasswordEncrypted";
  //public static String  = "";

  protected String logicalName;
  protected String url = "Not Set";
  protected String userName = "Not Set";
  protected String password = "Not Set";
  protected String serverName = null;

  /**	database server connection	*/
  protected Connection conn = null;
  /**	server with encrypted password	*/
  protected boolean useEncryption = true;
  /**	command line argument	*/
  protected String cmdArgument = null;

  /**	etc file properties */
  protected String propUserName = null;
  protected String propPassword = null;
  protected String propUrl = null;

  public SLDatabaseProperties ( String name )
  {
    logicalName = name;
  }

  public String getLogicalName()
  {
    return logicalName;
  }

  public String getUserName()
  {
    return userName;
  }

  public void setUserName( String s )
  {
    userName = s;
  }

  public String getPassword()
  {
    return password;
  }

  public void setPassword( String s )
  {
    password = s;
  }

  public String getCmdArgument()
  {
    return cmdArgument;
  }

  public void setCmdArgument( String s )
  {
    cmdArgument = s;
  }

  public String getPropUserName()
  {
    return propUserName;
  }

  public void setPropUserName( String s )
  {
    propUserName = s;
  }

  public String getPropPassword()
  {
    return propPassword;
  }

  public void setPropPassword( String s )
  {
    propPassword = s;
  }

  public String getPropUrl()
  {
    return propUrl;
  }

  public void setPropUrl( String s )
  {
    propUrl = s;
  }

  public String getUrl()
  {
    return url;
  }

  public void setUrl( String s )
  {
    url = s;
  }

  public Connection getConnection()
  {
    return conn;
  }

  public void setConnection( Connection c )
  {
    conn = c;
  }

  public void setEncryption( boolean b )
  {
    useEncryption = b;
  }

  public boolean useEncryption()
  {
    return useEncryption;
  }

  public String getServerName()
  {
    return serverName;
  }

  public void setServerName( String s )
  {
    serverName = s;
  }

}
